package mm.chenchen.common.utils;

import com.fasterxml.jackson.annotation.JsonIgnore;

public class PagingParam {
    private int start;
    private int limit;
    @JsonIgnore
    private boolean limitMax = true;

    public PagingParam() {
    }

    public PagingParam(int start, int limit) {
        this.start = start;
        this.limit = limit;
    }

    public int getStart() {
        return this.start;
    }

    public void setStart(int start) {
        this.start = start;
    }

    public int getLimit() {
        if (this.limit <= 0 || this.limitMax && this.limit > 100) {
            this.limit = 30;
        }

        return this.limit;
    }

    public void setLimit(int limit) {
        this.limit = limit;
    }

    public boolean getLimitMax() {
        return this.limitMax;
    }

    public void setLimitMax(boolean limitMax) {
        this.limitMax = limitMax;
    }
}
